package lesson01;

import java.awt.*;

public class TestGridLayout {
    public static void main(String[] args) {
        Frame frame=new Frame();
        //组件-按钮
        Button east = new Button("east");
        Button button2 = new Button("west");
        Button button3 = new Button("south");
        Button button4 = new Button("north");
        Button button5 = new Button("center");
        //设置表格布局
        frame.setLayout(new GridLayout(3,2));
        //把按钮加上去
        frame.add(east);
        frame.add(button2);
        frame.add(button3);
        frame.add(button4);
        frame.add(button5);
        frame.pack();//java函数，选择合适的位置
        frame.setVisible(true);
    }
}
